home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / libs / x / xview / xview3.004 / xview3 / usr / openwin / include / xview_private / hashfn.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-29  |  1.1 KB  |  54 lines

  1. /*    @(#)hashfn.h 20.10 93/06/28 SMI    */
  2.  
  3. /*
  4.  *    hashfn.h -- external declarations
  5.  */
  6.  
  7. /*
  8.  *    (c) Copyright 1989 Sun Microsystems, Inc. Sun design patents 
  9.  *    pending in the U.S. and foreign countries. See LEGAL NOTICE 
  10.  *    file for terms of the license.
  11.  */
  12.  
  13. #ifndef hashfn_h
  14. #define hashfn_h
  15.  
  16. #include <sys/types.h>
  17.  
  18. typedef struct he_ HashEntry;
  19.  
  20. struct he_ {
  21.     HashEntry    *he_next;
  22.     HashEntry    *he_prev;
  23.     caddr_t        he_key;
  24.     caddr_t        he_payload;
  25. };
  26.  
  27. typedef struct ht_ HashTable;
  28.  
  29. struct ht_ {
  30.     int            ht_size;
  31.     
  32.     /* hash func: int f(caddr_t) */
  33.     int            (*ht_hash_fn)();
  34.  
  35.     /* compare func: int f(caddr_t, caddr_t) returns 0 for equal */
  36.     int            (*ht_cmp_fn)();
  37.     HashEntry    **ht_table;
  38. };
  39.  
  40. #ifndef hashfn_c
  41.  
  42. extern HashTable *hashfn_new_table();
  43. extern void hashfn_dispose_table();
  44.  
  45. extern caddr_t /* payload pointer */ hashfn_lookup();
  46. extern caddr_t /* payload pointer */ hashfn_install();
  47. extern caddr_t /* payload pointer */ hashfn_delete();
  48.  
  49. extern caddr_t /* key pointer */ hashfn_first_key();
  50. extern caddr_t /* key pointer */ hashfn_next_key();
  51.  
  52. #endif hashfn_c
  53. #endif hashfn_h
  54.